<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var i = prompt("请输入一个三位数");
			if(i >= 100 && i < 1000){
				var bai = i/100%10;
				bai = parseInt(bai);
				//获取十位数
				var shi = i/10%10;
				shi = parseInt(shi);
				//获取个位
				var ge = i%10;
				ge = parseInt(ge);
				
				document.write("个位是："+ge+"<br/>十位是："+shi+"<br />百位是："+bai);
			}else{
				alert("输入错误！")
			}
		</script>
	</body>
</html>
